
{% extends "basic/base.html" %}
{% if not recipie %}
{% block title %} {{ recipie.name }} details {% endblock %}
{% endif %}

{% block content %}
{% if recipie %}
<h2> {{ recipie.name }} </h2>
{% if recipie.categories.all %}
	<p>Categories:</p>
    <ul>
        {% for category in recipie.categories.all %}
        <li>{{ category }}</li>
        {% endfor %}
    </ul>
{% endif %}

{% if recipie.items.all %}
    <p>Items:</p>
    <ul>
        {% for item in recipie.items.all %}
        <li> {{ item }}</li>
        {% endfor %}
    </ul>
    
	<p>Description:</p>
		<div style="background-color:silver;border-style:solid;">
			<p>{{ recipie.description }}</p>
		</div>
		{% if recipie.rating.votes %}
			<p>Rating:{{ recipie.rating.score }}</p>
		{% endif %}
{% endif %}   
<p>Added by {{ recipie.user }}</p>    
{% else %}
	<p>No such recipie!</p>
{% endif %}

{% endblock %}
